﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DemoPopupFile.ascx.cs"
    Inherits="NLLSite.Administrator.UserControl.DemoPopupFile" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<script type="text/javascript" src="../../ckfinder/ckfinder.js"></script>
<script type="text/javascript">

    function BrowseServer() {
        // You can use the "CKFinder" class to render CKFinder in a page:
        var finder = new CKFinder();
        finder.basePath = '../../ckfinder/'; // The path for the installation of CKFinder (default = "/ckfinder/").
        finder.selectActionFunction = SetFileField;
        finder.popup();

        // It can also be done in a single line, calling the "static"
        // popup( basePath, width, height, selectFunction ) function:
        // CKFinder.popup( '../', null, null, SetFileField ) ;
        //
        // The "popup" function can also accept an object as the only argument.
        // CKFinder.popup( { basePath : '../', selectActionFunction : SetFileField } ) ;
    }

    // This is a sample function which is called when a file is selected in CKFinder.
    function SetFileField(fileUrl) {
        document.getElementById('DemoPopupFile1_txtFilePatch').value = fileUrl;
        //Element ID = Ten class usercontrol + 1 + ID cua text box.
    }

</script>
<asp:TextBox ID="txtFilePatch" runat="server" AutoPostBack="True"></asp:TextBox>
<input type="button" value="Browse Server" onclick="BrowseServer();" />
